package com.youlai.boot.system.model.form;

import java.io.Serial;
import java.io.Serializable;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.*;

/**
 * 博客文章表单对象
 *
 * @author youlaitech
 * @since 2025-03-15 19:25
 */
@Getter
@Setter
@Schema(description = "博客文章表单对象")
public class ArchivesForm implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "文章ID")
    private Long id;

    @Schema(description = "文章标题")
    @Size(max=50, message="文章标题长度不能超过50个字符")
    private String title;

    @Schema(description = "封面图片")
    @Size(max=255, message="封面图片长度不能超过255个字符")
    private String image;

    @Schema(description = "文章简介")
    @Size(max=255, message="文章简介长度不能超过255个字符")
    private String description;

    @Schema(description = "文章内容")
    @Size(max= 16777215, message="文章内容长度不能超过65535个字符")
    private String content;

    @Schema(description = "文章类型（字典code：archives_type）")
    @NotNull(message = "文章类型（字典code：archives_type）不能为空")
    private String type;

    @Schema(description = "标签页")
    private List<String> tags;

    @Schema(description = "发布时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime publishTime;

    @Schema(description = "撤回时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime revokeTime;


}
